package dev.ece.suit.loader.models.fbx;

import dev.ece.suit.loader.Joint;
import dev.ece.util.lib.Matrix4f;

public class FBXUpdateJoint implements Joint<Float> {

	private FBXModel[] models;
	
	private FBXJoint[] joints;
	
	public FBXUpdateJoint(FBXModel[] models, FBXJoint[] joints) {
		this.models = models;
		this.joints = joints;
	}
	
	@Override
	public boolean hasKeyFrames() {
		return joints != null && models != null;
	}
	
	@Override
	public void update(Float current) {
		if(this.hasKeyFrames()) {
			this.updateGlobalTransform(current);
			for(FBXJoint joint: joints) {
				joint.update(current);
			}
		}
	}

	@Override
	public void updateGlobalTransform(Float current) {
		long time = FBXAnimationStack.fixFloatTimeToLong(current);
		for(FBXModel model: models) {
			model.updateGlobalTransform(time);
		}
	}

	@Override
	public boolean hasParent() {
		return false;
	}

	@Override
	public Joint<Float> getParent() {
		return null;
	}

	@Override
	public String getName() {
		return null;
	}

	@Override
	public Matrix4f getLocalTransform(Float current) {
		return null;
	}

	@Override
	public Matrix4f getGlobalTransform() {
		return null;
	}

	@Override
	public Matrix4f getOffsetTransform() {
		return null;
	}

	@Override
	public Matrix4f getFinalTransform() {
		return null;
	}

	@Override
	public Matrix4f getNormalTransform() {
		return null;
	}

}
